﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;

namespace Mark_dal
{
    public class Admin_dal
    {
        public bool UserLogin(string name, string pass)
        {
            string sql = string.Format(@"select * 
from Admin where Adminname='{0}' and Adminpwd = '{1}'", name, pass);

            SqlConnection conn = new SqlConnection(@"Data Source=.\SQLEXPRESS;Initial Catalog=market;Integrated Security=True");
            SqlCommand cmd = new SqlCommand(sql, conn);
            conn.Open();
            SqlDataReader dr = cmd.ExecuteReader();
            bool hasData = dr.Read();
            dr.Close();
            conn.Close();
            return hasData;
        }
    }
}
